package kr.saeildamil.androidstudy_second.fragment.common;

import kr.saeildamil.andrordstudy.second.R;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

public class PlanetDescFragment extends Fragment {
	int mNowIndex;
	
	public static PlanetDescFragment newInstance(int index){
		PlanetDescFragment df = new PlanetDescFragment();
		df.mNowIndex = index;
		return df;
	}
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		
		String[] planetDescs = getResources().getStringArray(R.array.PLANETDESC);
		
		View root = inflater.inflate(R.layout.ch20_planetdescfragment, container, false);
		TextView text = (TextView) root.findViewById(R.id.ch20_planetdescfragment_txtdescription);
		text.setText(planetDescs[mNowIndex]);
		
		return root;
	}
}





